<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Mini\BaseController;
use App\Models\User;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Facades\DB;

/**
 * 业主信息获取基类
 * Class BasicOwnerController
 * @package App\Http\Controllers
 */
class BasicOwnerController extends BaseController
{

    /**
     * @var int
     */
    public $ownerId;
    /**
     * @var User|Authenticatable|null
     */
    public $user;
    /**
     * @var mixed
     */
    public $owner;

    public function __construct()
    {
        DB::connection('mysql_center')->enableQueryLog();
        $this->user = auth('user')->user();
        $this->owner = $this->user->one_owner;
        if ($this->owner) {
            $this->ownerId=$this->owner->id;
        }else {
            $this->ownerId=0;
        }

    }
}
